#include "stdafx.h"
#include "./tmMusicBar.h"

using namespace GLES;

GLES::Bool tmMusicBar::createFrom( HWND hwnd,GLES::RectI& rect)
{
	_rect = rect;
	pict.createFromPVR("bg_bottom_bar.pvr");
	E_Return(_btn.createFrom("button_music_pause_normal.pvr","button_music_pause_pressed.pvr",PointI(20,20),&SizeI(60,40)));
	return true;
}

GLES::Void tmMusicBar::draw( GLES::Painter* painter /*= NULL*/ ,GLES::RectI* parent)
{
	painter->drawPict(_rect,&pict);
	_btn.draw(painter,&_rect);
}

VOID tmMusicBar::onInput( int x,int y,InputType type,GLES::RectI* parent /*= NULL */ )
{
	RectI o;
	Tool::translationRect(&o,&_rect,parent);
	return _btn.onInput(x,y,type,&o);
}